﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using NPOI.HSSF.UserModel;
using NPOI.HPSF;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace syc.Juece.Report
{
    public partial class 产成品收发存月报 : System.Web.UI.Page
    {
        protected HSSFWorkbook hssfworkbook;
        protected void Page_Load(object sender, EventArgs e)
        {

        }        

        protected void Button_Query_Click(object sender, EventArgs e)
        {
            DateTime 月初日期 = DateTime.Parse(this.RiQi.Text);
            DateTime 月末日期 = DateTime.Parse(this.RiQi2.Text);
            SqlConnection Conn = new SqlConnection();
            Conn.ConnectionString = ConfigurationManager.ConnectionStrings["SCMConnectionString1"].ConnectionString;
            Conn.Open();          
            SqlCommand Cmd = new SqlCommand();
            Cmd.Connection = Conn;
            Cmd.CommandText = "产成品收发存月报";
            Cmd.CommandType = CommandType.StoredProcedure;
            Cmd.Parameters.Add(new SqlParameter("@月初日期", SqlDbType.Date, 20, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, 月初日期));
            Cmd.Parameters.Add(new SqlParameter("@月末日期", SqlDbType.Date, 20, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, 月末日期));
            Cmd.ExecuteNonQuery();
            SqlDataReader sda = Cmd.ExecuteReader();
            while (sda.Read())
            {
                string a = sda.GetString(0);
            }
            Cmd.Dispose();
           
            Conn.Close();
            Conn.Dispose();
        }
    }
}
